<script setup>
//组合式函数调用
import { useMouse } from '../../utils/mouse.js'
import { inject, ref } from 'vue'
const i18n = inject('i18n')
console.log(i18n.greetings.hello)
const vFocus = {
  mounted: (el) => el.focus()
}
const show = ref(true)
</script>

<template>
  <div class="about">
    <h1>网店管理</h1>
    <input type="text" v-focus>
    <h1>{{ $translate('greetings.hello') }}</h1>
    <button @click="show = !show">Toggle</button>
    <Transition name="slide-fade">
      <p v-if="show">hello</p>
    </Transition>
  </div>
</template>

<style>
.slide-fade-enter-active {
  transition: all 0.3s ease-out;
}

.slide-fade-leave-active {
  transition: all 0.8s cubic-bezier(1, 0.5, 0.8, 1);
}

.slide-fade-enter-from,
.slide-fade-leave-to {
  transform: translateX(20px);
  opacity: 0;
}
</style>